<?php
namespace haibao\cms\kafka;
class PageMonitor extends Base{
	const TOPIC_NAME_PAGEMONITOR = 'PageMonitor';
	
	private static $topicName = '';
	
	public function __construct(){
		self::setTopicName(self::TOPIC_NAME_PAGEMONITOR);
	}
	
	public function setTopicName($topicName = ''){
		if ($topicName){
			self::$topicName = $topicName;
		}
	}
	
	public function sendMeesage($message = ''){
		if ($message){
			parent::product(self::$topicName,$message);
		}
	}

	public function getMessage(){
        return parent::consume(array(self::$topicName));
    }
}